window: Check if we can use CSD before enabling them
authorEmmanuele Bassi <ebassi@gnome.org>
Wed, 3 Jun 2015 13:07:29 +0000 (14:07 +0100)
committerEmmanuele Bassi <ebassi@gnome.org>
Wed, 3 Jun 2015 15:06:10 +0000 (16:06 +0100)
commitc5e5ee67490e7e7af56052d8f8beb75db002c2f1
tree97246aa3b2c2625f03c9edecfc2ce3ae65f72209
parentd37f94a524c7109cf1990eb864006111150f20fe
window: Check if we can use CSD before enabling them

The change in 03213b9509fc1df16c66194ea168aed6c15110e9 changed the rules
as to when CSD can be enabled, but it also unconditionally enables CSD
with the implicit assumption that client-side shadows were the real
issue, and that we could work around that by drawing our own borders.
This also means that setting a titlebar for a GtkWindow will enable CSD
unconditionally.

In reality, some window managers (like Matchbox) *only* support
server-side decorations, and will ignore all hints to the contrary, to
the point of drawing decorations at random locations on top of the
window.

Since CSD are enabled unconditionally, the GTK_CSD environment variable
is also not a suitable escape hatch.

In the grand tradition of asking ourselves if we should do something
just because we can, we should split the environment checks from the
checks on what the user requested; by doing that, we can also check
when enabling client-side decorations, and ideally bail out if needed.

https://bugzilla.gnome.org/show_bug.cgi?id=750343
gtk/gtkwindow.c